-
Notifications
You must be signed in to change notification settings - Fork 372
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Forward SOURCE_DATE_EPOCH to embedded k8s binaries #3542
Forward SOURCE_DATE_EPOCH to embedded k8s binaries #3542
Conversation
Make it possible for embedded binaries to pick up the SOURCE_DATE_EPOCH with which k0s is built. If supported, the embedded binaries will display the same build date as the k0s binary. Currently, only Kubernetes binaries will get the timestamp. It still needs to be checked what other binaries embed the build date. Also remove some Go build flags that get added by default in the Kubernetes build. Signed-off-by: Tom Wieczorek <[email protected]>
615ddc8
to
aa15d1e
Compare
export FORCE_HOST_GO=y; \ | ||
export KUBE_VERBOSE=9; \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this a deliberate change or is something that you commited accidentally? I'm not against it but I find this line surprising.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually, this prints out the arguments for the build, which is quite handy and is what I used to verify that the build picks up a custom SOURCE_DATE_EPOCH:
https://github.com/k0sproject/k0s/actions/runs/6378582878/job/17309435491?pr=3542#step:7:11718
Building binaries with GCFLAGS=all=-trimpath=/go/src/github.com/kubernetes/kubernetes/_output/local/go/src/k8s.io/kubernetes ASMFLAGS=all=-trimpath=/go/src/github.com/kubernetes/kubernetes/_output/local/go/src/k8s.io/kubernetes LDFLAGS=all=-X 'k8s.io/kubernetes/vendor/k8s.io/client-go/pkg/version.buildDate=2023-10-02T09:52:01Z' -X 'k8s.io/kubernetes/vendor/k8s.io/component-base/version.buildDate=2023-10-02T09:52:01Z' -X 'k8s.io/client-go/pkg/version.buildDate=2023-10-02T09:52:01Z' -X 'k8s.io/component-base/version.buildDate=2023-10-02T09:52:01Z' -X 'k8s.io/kubernetes/vendor/k8s.io/client-go/pkg/version.gitCommit=89a4ea3e1e4ddd7f7572286090359983e0387b2f' -X 'k8s.io/kubernetes/vendor/k8s.io/component-base/version.gitCommit=89a4ea3e1e4ddd7f7572286090359983e0387b2f' -X 'k8s.io/client-go/pkg/version.gitCommit=89a4ea3e1e4ddd7f7572286090359983e0387b2f' -X 'k8s.io/component-base/version.gitCommit=89a4ea3e1e4ddd7f7572286090359983e0387b2f' -X 'k8s.io/kubernetes/vendor/k8s.io/client-go/pkg/version.gitTreeState=clean' -X 'k8s.io/kubernetes/vendor/k8s.io/component-base/version.gitTreeState=clean' -X 'k8s.io/client-go/pkg/version.gitTreeState=clean' -X 'k8s.io/component-base/version.gitTreeState=clean' -X 'k8s.io/kubernetes/vendor/k8s.io/client-go/pkg/version.gitVersion=v1.28.2+k0s' -X 'k8s.io/kubernetes/vendor/k8s.io/component-base/version.gitVersion=v1.28.2+k0s' -X 'k8s.io/client-go/pkg/version.gitVersion=v1.28.2+k0s' -X 'k8s.io/component-base/version.gitVersion=v1.28.2+k0s' -X 'k8s.io/kubernetes/vendor/k8s.io/client-go/pkg/version.gitMajor=1' -X 'k8s.io/kubernetes/vendor/k8s.io/component-base/version.gitMajor=1' -X 'k8s.io/client-go/pkg/version.gitMajor=1' -X 'k8s.io/component-base/version.gitMajor=1' -X 'k8s.io/kubernetes/vendor/k8s.io/client-go/pkg/version.gitMinor=28' -X 'k8s.io/kubernetes/vendor/k8s.io/component-base/version.gitMinor=28' -X 'k8s.io/client-go/pkg/version.gitMinor=28' -X 'k8s.io/component-base/version.gitMinor=28' -extldflags=-static -s -w
Description
Make it possible for embedded binaries to pick up the
SOURCE_DATE_EPOCH
with which k0s is built. If supported, the embedded binaries will display the same build date as the k0s binary.Currently, only Kubernetes binaries will get the timestamp. It still needs to be checked what other binaries embed the build date.
Also remove some Go build flags that get added by default in the Kubernetes build.
Type of change
How Has This Been Tested?
Checklist: